
<?php if ($mode== "ADD"){?>
<section class="wrapper">
	<!-- page start-->
	<section class="panel">
		<header class="panel-heading"> LICENSE MANAGEMENT </header>
		<div class="panel-body">
			<form class="form-horizontal" role="form" name="news" method="POST"
				action="<?= base_url();?>secure/listing/listings/submit_license/<?= $profile_id;?>">
				<?php
				$this->session->flashdata('message'); {
					$msg = $this->session->flashdata('message');
					echo '<font color="red">' . $msg . '</font>';
				}
				?>
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">State</label>
					<div class="col-lg-4">
					<span class="text text-danger">
							<?php echo form_error('state'); ?></span>
						<input type="text" class="form-control" id="state" name="state"
							placeholder="State">
					</div>
				</div>


				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">License status</label>
					<div class="col-lg-4">
					<span class="text text-danger">
							<?php echo form_error('license_status'); ?></span>
						<input type="text" class="form-control" id="license_status" name="license_status"
							placeholder="License status">
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Acquired</label>
					<div class="col-lg-2">
					<span class="text text-danger">
							<?php echo form_error('acquired'); ?></span>
						<input type="text" class="form-control" id="acquired" name="acquired"
							placeholder="Acquired">
					</div>
				</div>

				<div class="form-group">
					<div class="col-lg-offset-2 col-lg-4">
					<input type="hidden" name="profile_id" value="<?= $profile_id?>">
					
						<input type="submit" class="btn btn-info pull-right" value="Add License"  <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  >
					</div>
				</div>


			</form>
		</div>
		<!-- End of Body Panel -->
	</section>
	
	<section class="panel">
					<header class="panel-heading"> LICENSE MANAGEMENT   </header>
					<div class="panel-body">
						<table class="table table-striped table-advance table-hover">
							<thead>
								<tr>
									<th><i class="icon-bullhorn"></i> State</th>
									<th class="hidden-phone "><i class="icon-bookmark"></i>
										License status</th>
									<th><i class="icon-bookmark"></i>Acquired</th>
									<th><i class=" icon-edit"></i> Action</th>
								</tr>
							</thead>
							<tbody>
							<?php if($licensce){?>
							<?php foreach($licensce as $licensce):?>
								<tr>
									<th><?= $licensce->location;?></th>
									<td class="hidden-phone"><?= $licensce->status;?></td>
									<td><?= $licensce->acquired;?></td>
									<td>
									
									
										<a href="<?= base_url();?>secure/listing/listings/edit_license/<?= $licensce->id; ?>" data-toggle="tooltip" title="Edit" onclick="return confirm('Are you sure you want to Edit?')">
										<button class="btn btn-primary btn-xs">
											<i class="icon-pencil"></i>
										</button>
										</a>
										<a href="<?= base_url();?>secure/listing/listings/delete_license/<?= $licensce->id;?>" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  data-toggle="tooltip" title="Delete">
										<button class="btn btn-danger btn-xs">
											<i class="icon-trash "></i>
										</button>
										</a>
									</td>
								</tr>
								
								<?php endforeach;}?>
							</tbody>
						</table>

						<!-- End of Body Panel -->
				</section>
	<!-- page end-->
</section>
<?php }?>
<?php if($mode== "EDIT"){?>

<section class="wrapper">
	<!-- page start-->
	<section class="panel">
		<header class="panel-heading"> LICENSE MANAGEMENT <span class="pull-right"><a href="<?= base_url();?>secure/listing/listings/add_license/<?= $license['info']->profile_id;?>" type="button" class="btn btn-success btn-sm">Back</a></span></header>
		<div class="panel-body">
			<form class="form-horizontal" role="form" name="news" method="POST"
				action="<?= base_url();?>secure/listing/listings/update_license">
				<?php
				$this->session->flashdata('message'); {
					$msg = $this->session->flashdata('message');
					echo '<font color="red">' . $msg . '</font>';
				}
				?>
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">State</label>
					<div class="col-lg-4">
					<span class="text text-danger">
							<?php echo form_error('state'); ?></span>
						<input type="text" class="form-control" id="state" name="state"
							placeholder="State" value="<?= $license['info']->location;?>">
					</div>
				</div>


				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">License status</label>
					<div class="col-lg-4">
					<span class="text text-danger">
							<?php echo form_error('license_status'); ?></span>
						<input type="text" class="form-control" id="license_status" name="license_status"
							placeholder="License status" value="<?= $license['info']->status;?>">
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Acquired</label>
					<div class="col-lg-2">
					<span class="text text-danger">
							<?php echo form_error('acquired'); ?></span>
						<input type="text" class="form-control" id="acquired" name="acquired"
							placeholder="Acquired" value="<?= $license['info']->acquired;?>">
					</div>
				</div>

				<div class="form-group">
					<div class="col-lg-offset-2 col-lg-4">
					<input type="hidden" name="id" value="<?= $license['info']->id;?>">
					<input type="submit" class="btn btn-info pull-right" value="Update"  <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  >
					</div>
				</div>


			</form>
		</div>
		<!-- End of Body Panel -->
	</section>
	</section>



<?php }?>